package com.rstrulak.dao;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.rstrulak.core.dao.GenericDaoImpl;
import com.rstrulak.model.Note;
import com.rstrulak.model.NoteAttachments;

@Repository("noteAttachmentsDao")
public class NoteAttachmentsDaoImpl extends GenericDaoImpl<NoteAttachments, Long> implements NoteAttachmentsDao {

	@Override
	public List<NoteAttachments> getNoteAttachemntsListByNote(Note note) {
		DetachedCriteria criteria = createDetachedCriteria();
		criteria.add(Restrictions.eq("note", note));
		return getListByCriteria(criteria);
	}

}
